package cn.wolfcode.qo;


import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

@Getter
@Setter
public class QueryObject {

    private String keyword;

    // 当前页
    private int currentPage = 1;
    // 每页条数
    private int pageSize = 5;

    public int getStart() {
        return (currentPage - 1) * pageSize;
    }

    public String getKeyword() {
        if (StringUtils.hasText(keyword)) {
            return keyword.replaceAll(" ", "");
        }
        return null;
    }

}
